<?php
class SsiFormController extends AppController{
	var $name = "SsiForm";
	var $uses = array('Member','SysParams');
	var $layout = 'ajax';
	function getNameKanji($name="Member/name_kanji",$class="i"){
		$this->Member->belongsTo = array();
		$this->Member->hasMany = array();
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'name_kanji');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->render('input');
	}
	function getNameKana($name="Member/name_kana",$class="i"){
		$this->Member->belongsTo = array();
		$this->Member->hasMany = array();
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'name_kana');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->render('input');
	}
	function getEmail($name="Member/email",$class="i"){
		$this->Member->belongsTo = array();
		$this->Member->hasMany = array();
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'email');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->render('input');
	}
	function getSexId($name="Member/sex_id",$class="i"){
		$this->Member->belongsTo = array();
		$this->Member->hasMany = array();
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'sex_id');
		$this->set('name',$name);
		$this->set('class',$class);
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='sex_id'";
		$data = $this->SysParams->generateList($condition);
		$this->set('data',$data);
		$this->render('select');
	}
	function getNationalityId($name="Member/nationality_id",$class="i"){
		$this->Member->belongsTo = array();
		$this->Member->hasMany = array();
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'nationality_id');
		$this->set('name',$name);
		$this->set('class',$class);
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='nationality_id'";
		$data = $this->SysParams->generateList($condition,'sort');
		$this->set('data',$data);
		$this->render('select');
	}
	function getBirthday($name="Member/birthday",$class="iDate"){
		$this->Member->belongsTo = array();
		$this->Member->hasMany = array();
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'birthday');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->render('calendar');
	}
	function getLanguageJp($name='Member/language_jp',$class="i"){
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='language_id'";
		$data = $this->SysParams->generateList($condition);
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'language_jp_id,language_jp_note');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->set('data',$data);
		$this->render('language');
	}
	function getLanguageCn($name='Member/language_ch_bj',$class="i"){
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='language_id'";
		$data = $this->SysParams->generateList($condition);
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'language_ch_bj_id,language_ch_bj_note');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->set('data',$data);
		$this->render('language');
	}
	function getLanguageEn($name='Member/language_en',$class="i"){
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='language_id'";
		$data = $this->SysParams->generateList($condition);
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'language_en_id,language_en_note');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->set('data',$data);
		$this->render('language');
	}
	function getLanguageCnGd($name='Member/language_ch_gd_id',$class="i"){
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='language_id'";
		$data = $this->SysParams->generateList($condition);
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'language_ch_gd_id');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->set('data',$data);
		$this->render('select');
	}
	function getLanguageOther1($name='Member/language_other',$class="i"){
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='language_id'";
		$data = $this->SysParams->generateList($condition);
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'language_other_id1,language_other_note1');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->set('data',$data);
		$this->render('language_other1');
	}
	function getLanguageOther2($name='Member/language_other',$class="i"){
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='language_id'";
		$data = $this->SysParams->generateList($condition);
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'language_other_id2,language_other_note2');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->set('data',$data);
		$this->render('language_other2');
	}
	function getAddress_1($name="Member/address_nation_id",$class="i"){
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='country_id'";
		$data = $this->SysParams->generateList($condition);
		$this->data = $this->Member->find('"Member"."id"= '.$this->rdAuth->id,'address_nation_id');
		$this->set('name',$name);
		$this->set('class',$class);
		$this->set('data',$data);
		$this->set('link','/ssiForm/ajaxCity');
		$this->render('select_ajax_1');
	}
	function getAddress_2($name="Member/address_location_id",$class='i'){
		$this->data = $this->Member->find('"Member"."id" = '.$this->rdAuth->id,'address_nation_id,address_location_id');
		$condition = "\"SysParams\".\"deleted\" is null and \"SysParams\".\"kbn\"='city_id' and \"SysParams\".\"pid\"=".$this->data['Member']['address_nation_id'];
		$data = $this->SysParams->generateList($condition);
		$this->set('name',$name);
		$this->set('class',$class);
		$this->set('data',$data);
		$this->render('select_ajax_2');
	}
	function ajaxCity($name="Member/address_location_id",$class='i'){
		$p=$this->data['Member']['address_nation_id'];
		$condition=" kbn ='city_id' and pid=".$p;
		$city_list=$this->SysParams->generateList($condition);
		$this->set('name',$name);
		$this->set('class',$class);
		$this->set("data",$city_list);
		$this->render('select_ajax_2');
	}
}
?>